<template>
  <div class="agent-profile">
    <h1>个人中心</h1>
    
    <div class="profile-tabs">
      <div class="tab active">个人信息</div>
      <div class="tab">账户安全</div>
      <div class="tab">通知设置</div>
      <div class="tab">操作日志</div>
    </div>
    
    <div class="profile-content">
      <div class="profile-card">
        <div class="profile-header">
          <div class="profile-avatar">
            <img src="https://via.placeholder.com/100" alt="用户头像">
            <div class="change-avatar">
              <i class="fas fa-camera"></i>
            </div>
          </div>
          <div class="profile-info">
            <h2 class="profile-name">张三</h2>
            <p class="profile-role">区域代理 <span class="status verified">已认证</span></p>
            <p class="profile-id">代理ID: AG12345678</p>
          </div>
          <div class="profile-actions">
            <button class="btn-outline">重置密码</button>
            <button class="btn-primary">编辑资料</button>
          </div>
        </div>
        
        <div class="profile-section">
          <h3 class="section-title">基本信息</h3>
          <div class="form-grid">
            <div class="form-group">
              <label>真实姓名</label>
              <input type="text" value="张三" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>手机号码</label>
              <input type="text" value="138****1234" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>电子邮箱</label>
              <input type="text" value="zhangsan@example.com" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>注册时间</label>
              <input type="text" value="2023-05-08" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>最后登录</label>
              <input type="text" value="2023-06-15 14:30:25" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>登录IP</label>
              <input type="text" value="192.168.1.1" class="form-input" readonly>
            </div>
          </div>
        </div>
        
        <div class="profile-section">
          <h3 class="section-title">代理信息</h3>
          <div class="form-grid">
            <div class="form-group">
              <label>代理区域</label>
              <input type="text" value="华东地区" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>佣金比例</label>
              <input type="text" value="15%" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>分销商数量</label>
              <input type="text" value="42" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>累计销售额</label>
              <input type="text" value="¥845,280.00" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>累计佣金</label>
              <input type="text" value="¥126,792.00" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>代理状态</label>
              <input type="text" value="正常" class="form-input status-normal" readonly>
            </div>
          </div>
        </div>
        
        <div class="profile-section">
          <h3 class="section-title">联系方式</h3>
          <div class="form-grid">
            <div class="form-group">
              <label>联系地址</label>
              <input type="text" value="上海市浦东新区张江高科技园区" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>邮政编码</label>
              <input type="text" value="201203" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>紧急联系人</label>
              <input type="text" value="李四" class="form-input" readonly>
            </div>
            <div class="form-group">
              <label>紧急联系电话</label>
              <input type="text" value="139****5678" class="form-input" readonly>
            </div>
          </div>
        </div>
        
        <div class="profile-section">
          <h3 class="section-title">账户绑定</h3>
          <div class="binding-list">
            <div class="binding-item">
              <div class="binding-icon wechat">
                <i class="fab fa-weixin"></i>
              </div>
              <div class="binding-info">
                <div class="binding-name">微信</div>
                <div class="binding-status">已绑定</div>
              </div>
              <button class="binding-action">解绑</button>
            </div>
            
            <div class="binding-item">
              <div class="binding-icon alipay">
                <i class="fab fa-alipay"></i>
              </div>
              <div class="binding-info">
                <div class="binding-name">支付宝</div>
                <div class="binding-status">已绑定</div>
              </div>
              <button class="binding-action">解绑</button>
            </div>
            
            <div class="binding-item">
              <div class="binding-icon weibo">
                <i class="fab fa-weibo"></i>
              </div>
              <div class="binding-info">
                <div class="binding-name">微博</div>
                <div class="binding-status">未绑定</div>
              </div>
              <button class="binding-action bind">绑定</button>
            </div>
          </div>
        </div>
      </div>
    </div>
  </div>
</template>

<script setup lang="ts">
// 个人中心页面组件逻辑
</script>

<style scoped>
.agent-profile {
  padding: 20px;
}

.profile-tabs {
  display: flex;
  border-bottom: 1px solid #e5e7eb;
  margin-bottom: 20px;
}

.tab {
  padding: 12px 20px;
  cursor: pointer;
  font-weight: 500;
  color: #6b7280;
  border-bottom: 2px solid transparent;
  transition: all 0.2s;
}

.tab:hover {
  color: #3b82f6;
}

.tab.active {
  color: #3b82f6;
  border-bottom-color: #3b82f6;
}

.profile-card {
  background-color: white;
  border-radius: 8px;
  overflow: hidden;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.05);
}

.profile-header {
  display: flex;
  padding: 30px;
  background-color: #f9fafb;
  border-bottom: 1px solid #e5e7eb;
  align-items: center;
}

.profile-avatar {
  position: relative;
  margin-right: 30px;
}

.profile-avatar img {
  width: 100px;
  height: 100px;
  border-radius: 50%;
  border: 3px solid white;
  box-shadow: 0 2px 10px rgba(0, 0, 0, 0.1);
}

.change-avatar {
  position: absolute;
  right: 0;
  bottom: 0;
  width: 30px;
  height: 30px;
  background-color: #3b82f6;
  color: white;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  cursor: pointer;
  box-shadow: 0 2px 5px rgba(0, 0, 0, 0.1);
}

.profile-info {
  flex: 1;
}

.profile-name {
  margin: 0 0 5px;
  font-size: 24px;
  color: #111827;
}

.profile-role {
  display: flex;
  align-items: center;
  margin: 0 0 5px;
  color: #6b7280;
}

.status {
  margin-left: 10px;
  padding: 2px 8px;
  border-radius: 10px;
  font-size: 12px;
  font-weight: 500;
}

.status.verified {
  background-color: #d1fae5;
  color: #047857;
}

.profile-id {
  margin: 0;
  color: #6b7280;
  font-size: 14px;
}

.profile-actions {
  display: flex;
  gap: 10px;
}

.btn-primary,
.btn-outline {
  padding: 10px 20px;
  border-radius: 6px;
  font-weight: 500;
  cursor: pointer;
  transition: all 0.2s;
}

.btn-primary {
  background-color: #3b82f6;
  color: white;
  border: none;
}

.btn-primary:hover {
  background-color: #2563eb;
}

.btn-outline {
  background-color: transparent;
  border: 1px solid #3b82f6;
  color: #3b82f6;
}

.btn-outline:hover {
  background-color: #f0f7ff;
}

.profile-section {
  padding: 20px 30px;
  border-bottom: 1px solid #e5e7eb;
}

.section-title {
  margin: 0 0 20px;
  font-size: 18px;
  color: #374151;
  font-weight: 600;
}

.form-grid {
  display: grid;
  grid-template-columns: repeat(auto-fill, minmax(300px, 1fr));
  gap: 20px;
}

.form-group {
  display: flex;
  flex-direction: column;
}

.form-group label {
  margin-bottom: 5px;
  color: #6b7280;
  font-size: 14px;
}

.form-input {
  padding: 10px 12px;
  border: 1px solid #e5e7eb;
  border-radius: 6px;
  background-color: #f9fafb;
  color: #374151;
}

.form-input:focus {
  outline: none;
  border-color: #3b82f6;
  box-shadow: 0 0 0 3px rgba(59, 130, 246, 0.1);
}

.form-input.status-normal {
  color: #047857;
  font-weight: 500;
}

.binding-list {
  display: flex;
  flex-direction: column;
  gap: 15px;
}

.binding-item {
  display: flex;
  align-items: center;
  padding: 15px;
  border: 1px solid #e5e7eb;
  border-radius: 8px;
  background-color: #f9fafb;
}

.binding-icon {
  width: 40px;
  height: 40px;
  border-radius: 50%;
  display: flex;
  align-items: center;
  justify-content: center;
  margin-right: 15px;
  color: white;
  font-size: 20px;
}

.binding-icon.wechat {
  background-color: #07c160;
}

.binding-icon.alipay {
  background-color: #1677ff;
}

.binding-icon.weibo {
  background-color: #e6162d;
}

.binding-info {
  flex: 1;
}

.binding-name {
  font-weight: 500;
  color: #374151;
  margin-bottom: 3px;
}

.binding-status {
  font-size: 14px;
  color: #6b7280;
}

.binding-action {
  padding: 6px 12px;
  border-radius: 4px;
  background-color: transparent;
  border: 1px solid #ef4444;
  color: #ef4444;
  cursor: pointer;
  font-size: 14px;
  transition: all 0.2s;
}

.binding-action:hover {
  background-color: #fee2e2;
}

.binding-action.bind {
  border-color: #3b82f6;
  color: #3b82f6;
}

.binding-action.bind:hover {
  background-color: #eff6ff;
}

@media (max-width: 768px) {
  .profile-header {
    flex-direction: column;
    align-items: center;
    text-align: center;
  }
  
  .profile-avatar {
    margin-right: 0;
    margin-bottom: 20px;
  }
  
  .profile-actions {
    margin-top: 20px;
  }
  
  .form-grid {
    grid-template-columns: 1fr;
  }
}
</style> 